#ifndef DATA_H
#define DATA_H


#include "stm32f10x.h"
#include "Pid.h"


#define IIC I2C2 //磁编码器通信


extern float sensor_direction;//编码器方向
extern float pole_pairs;//电机极对数
extern float voltage_power_supply ;//供电电压
extern float Ualpha,Ubeta,Ua,Ub,Uc;
extern float zero_electric_angle;


extern PID PID_Pos;//位置PID
extern PID PID_Vel;//速度PID
extern PID PID_Cur;//电流PID
extern float position;//位置
extern float velocity;//速度
extern float current;//电流


extern float gain_a,gain_b,gain_c;//欧姆定律系数
extern float offset_ia,offset_ib,offset_ic;//采集的3路电流
extern float volts_to_amps_ratio;
extern float shunt_resistor ;//采样电阻值
extern float amp_gain;//运放增益
extern float current_a,current_b;//帕克变换的值







#endif 
